

<?php                         // My Information  Page 

 
                              // Password Data Form 
?>
<form action="info/contact"  method="post">
  <table>
    <tr>
      <h3>Change Password </h3> <br>
      <th><label for="oldpass">Current Pass:</label></th>
      <td><input type="text" name="oldpass" id="oldpass" /></td>
    </tr>
    <tr>
    <th><label for="newpass">New  Pass :</label></th>
      <td><input type="text" name="newpass" id="newpass" /></td>
    </tr>
     <tr>
    <th><label for="conpass">Confirm Pass :</label></th>
      <td><input type="text" name="conpass" id="conpass" /></td>
    </tr>
    <tr>
      <td colspan="2">
        <input type="submit" name="submit1" value="save" />
      </td>
    </tr>
  </table>
</form>

<?php                      //Validation
?>

<br>
<?php if (isset($_POST['submit1']))  :?>
     
    <?php if ( (empty($_POST['oldpass'])) || (empty($_POST['newpass'])) || (empty($_POST['conpass']))  ) :?>
      <?php echo 'Please Fill all field' ; ?>
      <?php endif; ?>
   
                   <?php if ( (!empty($_POST['oldpass'])) && (!empty($_POST['newpass'])) && (!empty($_POST['conpass'])) )  :?>
                            <?php if ( ($_POST['newpass'])!=($_POST['conpass']) )  :?>
                              <?php echo 'The new password and its confirmation are not identical' ; ?>
                            
                       <?php else  : ?>
                       <?php echo 'New changes have been saved' ; ?>
                            <?php endif; ?>
                      <?php endif; ?>    
                               
<?php endif; ?>


<?php                        // Email Data Form
?>
        
<form action="info/contact"  method="post">
  <table>
    <tr>
      <h3>Change Email </h3> <br>
      <th><label for="oldmail">Current Email:</label></th>
      <td><input type="text" name="oldmail" id="oldmail" /></td>
    </tr>
    <tr>
    <th><label for="newmail">New  Email :</label></th>
      <td><input type="text" name="newmail" id="newmail" /></td>
    </tr>
     <tr>
    <th><label for="conmail">Confirm Email :</label></th>
      <td><input type="text" name="conmail" id="conmail" /></td>
    </tr>
    <tr>
      <td colspan="2">
        <input type="submit"  name="submit2"  value="save" />
      </td>
    </tr>
  </table>
</form>

<?php                      //validation
?>

<br>
<?php if (isset($_POST['submit2']))  :?>
     
    <?php if ( (empty($_POST['oldmail'])) || (empty($_POST['newmail'])) || (empty($_POST['conmail']))  ) :?>
      <?php echo 'Please Fill all field' ; ?>
      <?php endif; ?>
   
                   <?php if ( (!empty($_POST['oldmail'])) && (!empty($_POST['newmail'])) && (!empty($_POST['conmail'])) )  :?>
                            <?php if ( ($_POST['newmail'])!=($_POST['conmail']) )  :?>
                              <?php echo 'The new email and its confirmation are not identical' ; ?>
                            
                       <?php else  : ?>
                       <?php echo 'New changes have been saved' ; ?>
                            <?php endif; ?>
                      <?php endif; ?>    
                               
<?php endif; ?>

<?php                 // Upload Form 
?>

<form action="" method="post" enctype="multipart/form-data">
<h3>Curriculum Vitae </h3> <br>
<input type="file" name="myFile" />
<br /><br />
<input type="submit" name="submit3" value="Upload CV" /> 
</form>

<?php
//Maximum of File Size In Bytes
$configs['maxSize'] = 1000;
//path of file
$configs['uploadPath'] = 'uploads';

?>
 
<?php if (isset($_POST['submit3']))  :?>
       
<?php //Check If File Uploaded 
?>

<?php if(isset($_FILES['myFile']) && is_uploaded_file($_FILES['myFile']['tmp_name'])) : ?>
         
      

                    <?php  if(($_FILES['myFile']['size']/1024) <= $configs['maxSize']) : ?>
                
                        <?php   move_uploaded_file($_FILES['myFile']['tmp_name'],realpath($configs['uploadPath']).'/'.$_FILES['myFile']['name']);
                         echo ' File : '.$_FILES['myFile']['name'].' Uploaded Successfully .'; ?>

                        <?php else  : ?>
                        <?php  echo '<a href="javascript:history.back();">Back</a><br />';
                        die("File is larger than allowed size"); ?>
                       <?php endif; ?>
                        
                     <?php else  : ?>
                           <?php echo 'Please choose file' ; ?>
                           
        
 <?php endif; ?>
 <?php endif; ?>

